package export.magicWeapon
{
	import base.BaseAddEffect;
	import base.BaseBitmapDataClip;
	import base.BaseBitmapDataPool;
	import base.BaseHero;
	import base.BaseMagicWeapon;
	
	import com.game.data.vo.EquipmentVO;
	import com.greensock.TweenMax;
	
	import flash.geom.Point;
	
	public class MagicSXFB extends BaseMagicWeapon
	{
		
		public function MagicSXFB(bo:BaseHero)
		{
			super(bo);
			this.mp = 10;
		}
		
		override protected function initBBDC():void
		{
			var body:* = null;
			var bmdArray:Array = BaseBitmapDataPool.getBitmapDataArrayByName("MagicSXFBBmd");
			if (bmdArray)
			{
				body = {
					"name"  : "body",
					"source": bmdArray
				};
				bbdc = new BaseBitmapDataClip([body], 61, 50, new Point(0, 0));
				bbdc.setOffsetXY(1, -10);
				bbdc.setFrameStopCount([[10], [9999]]);
				bbdc.setFrameCount([1, 1]);
				bbdc.setAddScriptWhenFrameOver(scriptFrameOverFunc);
				this.addChild(bbdc);
				return;
			}
			throw new Error("MagicLXFBBmd--BitmapData Error!");
		}
		
		override public function showSkill():void
		{
			var timeCount:uint = 0;
			var equip:EquipmentVO = null;
			if (this.sourceRole)
			{
				timeCount = gc.frameClips * 7;
				equip = this.sourceRole.getPlayer().getCurEquipByType("zbfb");
				if (equip && equip.getFiveElementString().indexOf("木") != -1)
				{
					timeCount *= 2;
				}
				this.sourceRole.addCurAddEffect([{
					"name": BaseAddEffect.SXFB_BUFF,
					"time": timeCount
				}]);
				TweenMax.delayedCall(21, function (_self:MagicSXFB):*
				{
					_self.setAction("idle");
				}, [this]);
			}
		}
	}
}
